package com.example.birdfriends.service.impl;

import com.example.birdfriends.dao.PraiseDao;
import com.example.birdfriends.pojo.praise.Praise;
import com.example.birdfriends.service.PraiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PraiseServiceImpl implements PraiseService {
    @Autowired
    private PraiseDao praiseDao = null;

    @Override
    public int praisePost(Praise praise) {
        return praiseDao.praisePost(praise);
    }

    @Override
    public List<Long> findPraisesByPid(Long pid) {
        return praiseDao.findPraisesByPid(pid);
    }

    @Override
    public List<Long> findPraisesByPidAndUid(Long pid, Long uid) {
        return praiseDao.findPraiseByPidAndUid(pid, uid);
    }

    @Override
    public int deletePraise(Long pid, Long uid) {
        return praiseDao.deletePraise(pid, uid);
    }

    @Override
    public List<Long> findUidsInPraisesByPid(Long pid) {
        return praiseDao.findUidsInPraisesByPid(pid);
    }

    @Override
    public List<Praise> findPraises() {
        return praiseDao.findPraises();
    }
}
